Passed
Push — master ( 9c80d9...628b52 )
by MusikAnimal
05:31
created

autoedits.js ➔ ... ➔ $.fail   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 3
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
$(function () {
2
    if (!$('body.autoedits').length) {
3
        return;
4
    }
5
6
    setupToggleTable(window.countsByTool, window.toolsChart, 'count', function (newData) {
7
        var total = 0;
8
        Object.keys(newData).forEach(function (tool) {
9
            total += parseInt(newData[tool].count, 10);
10
        });
11
        var toolsCount = Object.keys(newData).length;
12
        /** global: i18nLang */
13
        $('.tools--tools').text(
14
            toolsCount.toLocaleString(i18nLang) + " " +
15
            $.i18n('num-tools', toolsCount)
16
        );
17
        $('.tools--count').text(total.toLocaleString(i18nLang));
18
    });
19
20
    // Load the contributions browser, or set up the listeners if it is already present.
21
    var initFunc = $('.contributions-table').length ? 'setupContributionsNavListeners' : 'loadContributions';
22
    window[initFunc](
23
        function (params) {
24
            return params.target + '-contributions/' + params.project + '/' + params.username + '/' +
25
                params.namespace + '/' + params.start + '/' + params.end;
26
        },
27
        $('.contributions-container').data('target')
28
    );
29
});
30